// ignore_for_file: use_build_context_synchronously

import 'package:get/get.dart';
import 'package:xvideos/hj_utils/api_service/mine_service.dart';
import 'package:xvideos/tools_base/widget/LoadingWidget.dart' as l;

import '../../config/address.dart';
import '../web_page/h5_page.dart';

class MineUtils {
  static void goCSPage() async {
    l.LoadingWidget loadingWidget = l.LoadingWidget();
    loadingWidget.show();
    dynamic data;
    try {
      data = await MineService.fetchCustomService();
      loadingWidget.cancel();
    } catch (e) {
      loadingWidget.cancel();
      return;
    }
    String url = '${Address.baseHost}/api$data';
    Get.to(
      H5Page(url: url, title: '在线客服'),
      opaque: false,
    );
  }
}
